<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>正则表达式</title>
</head>
<body>
    <script>
        let str = "amy pinb like pink";
        let reg = /pin[a-z]/g;
        console.log(str.match(reg))
        console.log(str.search(reg))
        console.log(str.replace(reg,"123"))

        let str2 = "red,pink|blue,white";
        console.log(str2.split(/[,|]/))
    </script>
</body>
</html>